﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="CreateMaster.aspx.cs" Inherits="Pages_CreateMaster" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div>
    <script language="JavaScript" type="text/javascript">
        function DisableControl() {
            
            if (document.getElementById("<%=txtDate.ClientID%>") != null) {
                document.getElementById("<%=txtDate.ClientID%>").readOnly = true;
            }
            if (document.getElementById("<%=txtPurchaseDate.ClientID%>") != null) {
                document.getElementById("<%=txtPurchaseDate.ClientID%>").readOnly = true;
            }
        }
</script>
    <center>
            <hr />
            <asp:HiddenField ID="hdnVehicleId" runat="server" />
            <table border="0" cellpadding="1" cellspacing="2" width="40%">
                <tr runat="server" id="trMessage" visible="false">
                    <td colspan="2">
                        <div class="alert">
                            Record Created Successfully.</div>
                    </td>
                </tr>
                <tr runat="server" id="trError" visible="false">
                    <td colspan="2">
                        <div class="error">
                            Record Already Exists.</div>
                    </td>
                </tr>
            </table>
            <asp:Panel ID="PanComp" runat="server" Visible="false">
                <div style="text-align: center">
                                      
                    <center>
                        <table border="0" cellpadding="1" cellspacing="2" width="50%">
                            <tr>
                                <td align="center" colspan="2" style="font-weight: bold; font-size: 0.9em; color: white;
                                    background-color: #5d7b9d">
                                    Create New Company
                                </td>
                            </tr>
                            <tr id="trCompStatus" runat="server" visible="false">
                                <td align="left">
                                    Status
                                </td>
                                <td align="left">
                                    <b>
                                        <asp:Label ID="lblCompStatus" runat="server"></asp:Label></b>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Type
                                </td>
                                <td align="left">
                                    <asp:DropDownList ID="ddlCompType" runat="server" Width="93%">
                                   
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Name:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtCompanyName" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtCompanyName"
                                        ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Address:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtAddress" runat="server" TextMode="multiline" Width="91%"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="txtAddress"
                                        ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Contact No:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtContactNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Email:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtEmail" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    VAT/TIN No:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtVat" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Company Logo:
                                </td>
                                <td align="left">
                                    <asp:FileUpload ID="fldLogo" runat="server" Width="91%" />
                                </td>
                            </tr>
                            <tr id="trCompImage" runat="server" visible="false">
                                <td colspan="2">
                                    <asp:Image ID="imgCompLogo" runat="server" Height="80px" Width="80px" />
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2" style="color: red">
                                    <asp:ValidationSummary ID="valSum" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2" style="text-align: center">
                                    <asp:Button ID="LoginButton" SkinID="DefaultButton" runat="server" Text="Create Company"
                                        ValidationGroup="Login1" OnClick="LoginButton_Click" />
                                    <asp:Button ID="Button2" SkinID="DefaultButton" runat="server" Text="Reset" ValidationGroup="Rest" />
                                </td>
                            </tr>
                        </table>
                    </center>
                </div>
            </asp:Panel>
            <asp:Panel ID="dvChallan" runat="server" Visible="false">
                <asp:HiddenField ID="hdnChallanId" runat="server" />
                <center>
                    <table border="0" cellpadding="1" cellspacing="2" width="50%">
                        <tr>
                            <td align="center" colspan="2" style="font-weight: bold; font-size: 0.9em; color: white;
                                background-color: #5d7b9d">
                                Create New Challan
                            </td>
                        </tr>
                        <tr id="trStatus" runat="server" visible="false">
                            <td align="left">
                                Status
                            </td>
                            <td align="left">
                                <b>
                                    <asp:Label ID="lblStatus" runat="server"></asp:Label></b>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Date:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtDate" runat="server"  Width="90%"></asp:TextBox>
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
                                    Format="MMMM d, yyyy" PopupPosition="BottomRight" />
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Transport Company Name:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlTransport" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Supplier Company Name:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlSupplier" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Contractor Company Name:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlContractor" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Truck Number:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlTruckNo" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Challan Number:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtChallanNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Weight:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtCFT" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Ticket Number:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtTicketNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Material:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlMaterial" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Driver Name:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlDriver" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Cleaner Name:
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlCleaner" runat="server" Width="93%">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr runat="server" id="trMs" visible="false">
                            <td align="left">
                                Reason for Rejection:
                            </td>
                            <td align="left" style="background-color: Red">
                                <asp:Label ID="lblRejectReason" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Challan Copy:
                            </td>
                            <td align="left">
                                <asp:FileUpload ID="imgChallan" runat="server" Width="91%" />
                            </td>
                        </tr>
                        <tr id="trImg" runat="server" visible="false">
                            <td colspan="2">
                                <asp:Image ID="imgLogo" runat="server" Height="80px" Width="80px" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2" style="text-align: center">
                                <asp:Button ID="btnCreate" SkinID="DefaultButton" runat="server" Text="Create Challan"
                                    ValidationGroup="Login1" OnClick="btnCreate_Click" />
                                <asp:Button ID="btnClear" SkinID="DefaultButton" runat="server" Text="Reset" ValidationGroup="Rest" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div id="dvError" runat="server" visible="false" style="background-color: Red">
                                    <b>System Error: </b>
                                    <asp:Literal ID="ltlError" runat="server"></asp:Literal>
                                </div>
                            </td>
                        </tr>
                    </table>
                </center>
            </asp:Panel>
            <asp:Panel ID="dvTruck" Visible="false" runat="server">
                <center>
                    <table border="0" cellpadding="1" cellspacing="2" width="40%">
                        <tr>
                            <td align="center" colspan="2" style="font-weight: bold; font-size: 0.9em; color: white;
                                background-color: #5d7b9d">
                                Create New Truck Details
                            </td>
                        </tr>
                        <tr id="trTrcukStatus" runat="server" visible="false">
                            <td align="left">
                                Status
                            </td>
                            <td align="left">
                                <b>
                                    <asp:Label ID="lblTruckStatus" runat="server"></asp:Label></b>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Truck Number
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtTruckNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Truck Model Number:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtModelNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Purchase Date:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtPurchaseDate" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtPurchaseDate"
                                    Format="MMMM d, yyyy" PopupPosition="BottomRight" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2" style="text-align: center">
                                <asp:Button ID="btnCreateTruck" SkinID="DefaultButton" runat="server" Text="Create Truck"
                                    ValidationGroup="Login1" OnClick="btnCreateTruck_Click" />
                                <asp:Button ID="btnReset" SkinID="DefaultButton" runat="server" Text="Reset" ValidationGroup="Rest" />
                            </td>
                        </tr>
                    </table>
                </center>
            </asp:Panel>
            <asp:Panel ID="dvEmployee" Visible="false" runat="server">
                <center>
                    <table border="0" cellpadding="1" cellspacing="2" width="40%">
                        <tr>
                            <td align="center" colspan="2" style="font-weight: bold; font-size: 0.9em; color: white;
                                background-color: #5d7b9d">
                                Create New Employee
                            </td>
                        </tr>
                        <tr id="trEmpStatus" runat="server" visible="false">
                            <td align="left">
                                Status
                            </td>
                            <td align="left">
                                <b>
                                    <asp:Label ID="lblEmpStatus" runat="server"></asp:Label></b>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Employee Name
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtName" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Employee Number:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtEmpNo" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Address:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtEmpAddress" runat="server" TextMode="multiline" Width="91%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Contact No:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtEmpContact" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                ID Proof:
                            </td>
                            <td align="left">
                                <asp:FileUpload ID="fldIDProof" runat="server" Width="91%" />
                            </td>
                        </tr>
                        <tr id="tr8" runat="server" visible="false">
                            <td colspan="2">
                                <asp:Image ID="imgIDProof" runat="server" Height="80px" Width="80px" />
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                Licence:
                            </td>
                            <td align="left">
                                <asp:FileUpload ID="fldLicence" runat="server" Width="91%" />
                            </td>
                        </tr>
                        <tr id="trLicence" runat="server" visible="false">
                            <td colspan="2">
                                <asp:Image ID="imgLicence" runat="server" Height="80px" Width="80px" />
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2" style="color: red">
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2" style="text-align: center">
                                <asp:Button ID="btnCreateEmp" SkinID="DefaultButton" runat="server" Text="Create Employee"
                                    OnClick="btnCreateEmp_Click" />
                                <asp:Button ID="btnRestEmp" SkinID="DefaultButton" runat="server" Text="Reset" ValidationGroup="Rest" />
                            </td>
                        </tr>
                    </table>
                </center>
            </asp:Panel>
            <asp:Panel ID="dvMaterial" Visible="false" runat="server">
                <div style="text-align: center">
                    <br />
                    <div id="Div1" runat="server" visible="false">
                        <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                        <asp:HiddenField ID="hdnCOmpId" runat="server" />
                    </div>
                    <center>
                        <table border="0" cellpadding="1" cellspacing="2" width="40%">
                          
                            <tr>
                                <td align="center" colspan="2" style="font-weight: bold; font-size: 0.9em; color: white;
                                    background-color: #5d7b9d">
                                    Create New Material
                                </td>
                            </tr>
                            <tr id="trMaterialStatus" runat="server" visible="false">
                                <td align="left">
                                    Status
                                </td>
                                <td align="left">
                                    <b>
                                        <asp:Label ID="lblMaterialStatus" runat="server"></asp:Label></b>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Material Name:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtMaterialName" runat="server" Font-Size="0.8em" Width="90%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    Material Descriptipn:
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtDescription" runat="server" TextMode="multiline" Width="91%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2" style="text-align: center">
                                    <asp:Button ID="btnCreateMaterial" SkinID="DefaultButton" runat="server" Text="Create Material"
                                        ValidationGroup="Login1" OnClick="btnCreateMaterial_Click" />
                                    <asp:Button ID="Button3" SkinID="DefaultButton" runat="server" Text="Reset" ValidationGroup="Rest" />
                                </td>
                            </tr>
                        </table>
                    </center>
                </div>
            </asp:Panel>
        </center>
    </div>
</asp:Content>
